/* McPacket.h
 *
 * --
 * Copyright (c) 2012, Christophe Huriaux
 * Distributed under the terms of the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * --
 */

#ifndef MCPACKET_H
#define MCPACKET_H

#include <iostream>
#include <stdint.h>

class McPacket
{
	unsigned int	packetId;

public:
	McPacket(unsigned int id);
	virtual ~McPacket() {};

	int getPacketId();

	virtual unsigned int length() = 0;
};

class McPacketToServer : public McPacket
{
public:
	McPacketToServer(unsigned int id);
	virtual ~McPacketToServer() {};

	virtual void forge(std::ostream & out) = 0;
};

class McPacketFromServer : public McPacket
{
public:
	McPacketFromServer(unsigned int id);
	virtual ~McPacketFromServer() {};

	virtual int16_t setField(uint8_t field, void* value) = 0;
};

#endif
